
//promptReportPopup page contained this javascript code
if(document.forms['sendDataForm'].sendData.value == "1"){
 	var optionSelect= true;
	var dropDownSize = window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).length;
	var valuesList = document.forms['sendDataForm'].valuesList.value.split("#");
	var textsList = document.forms['sendDataForm'].textsList.value.split("#");
	
	var batchReportPage = false;
	try{		
		if(window.opener.document.forms[0].id=="batchReportScheduleRequestForm"){
			batchReportPage=true;
		}
	}catch(e) {					
	}
	
	if(!batchReportPage) {
		window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).length = valuesList.length + 1;	

		for(var index=0; index < valuesList.length; index++){
				window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[index].value = valuesList[index];
				window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[index].text = textsList[index];
				
				if(document.forms['sendDataForm'].selectedOption.value == valuesList[index]){
					window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).selectedIndex = index;
				}	

		}
		window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[valuesList.length].value = 'MORE';
		window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[valuesList.length].text = document.forms['promptReportForm'].moreMessageValue.value;
		if(document.forms['promptReportForm'].promptSubmit.value == "true"){
			if("pop_accountNo"==document.forms['promptReportForm'].reportId.value){
				window.opener.document.forms[document.forms['promptReportForm'].promptFormName.value].accountId.onchange();
			}else{
				window.opener.document.forms[document.forms['promptReportForm'].promptFormName.value].submit();
			}
		}
		document.forms['unloadCheck'].windowClose.value = "0";
		window.close();
	} else {
		var parentSelectElement = window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value);			
		for(var index=0; index < valuesList.length; index++)
		{
			if(document.forms['sendDataForm'].selectedOption.value == valuesList[index])
			{				
				if(index!=0) {
					//swap the selected and first elements in array				
					var tmpKey = textsList[0];
					var tmpValue = valuesList[0];
					textsList[0] = textsList[index];
					valuesList[0] = valuesList[index];					
					textsList[index] = tmpKey;
					valuesList[index] = tmpValue;
				}
			}
		}
		var len = parentSelectElement.length-2;
		if(valuesList.length<len)
			len = valuesList.length;
		for(var index=0; index < valuesList.length && len-->0; index++){			
			parentSelectElement.options[index+1].text = textsList[index];
			parentSelectElement.options[index+1].value = valuesList[index];			
		}				
		parentSelectElement.selectedIndex = 1;				
		document.forms['unloadCheck'].windowClose.value = "0";
		window.close();
	}
 }
 
 if(document.forms['sendDataForm'].sendData.value == "2"){
  	var optionSelect= true;
 	var dropDownSize = window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).length;
 	var valuesList = document.forms['sendDataForm'].valuesList.value.split("#");
 	var textsList = document.forms['sendDataForm'].textsList.value.split("#");
 	/*
 	window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).length = valuesList.length + 1;	
 	for(var index=0; index < valuesList.length; index++){
 	        window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[index].value = valuesList[index];
 	        window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[index].text = textsList[index];
 	}
 	window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[valuesList.length].value = 'MORE';
	window.opener.document.getElementById(document.forms['promptReportForm'].promptName.value).options[valuesList.length].text = document.forms['promptReportForm'].moreMessageValue.value;
 	*/
 }
